<template>
  <div class="parentWrapper">
      <Parent v-if="parentData.parent" :parentData="parentData.parent"/>
      <div class="info">
          <div class="name">{{parentData.user.nickname}}</div>
          <div class="date">3小时前</div>
          <div class="btnReply" @click="handleClick">回复</div>
      </div>
      <div class="mainContent">
        {{parentData.content}}
      </div>
  </div>
</template>

<script>
import eventBus from '../../utils/eventBus'
export default {
    name: 'Parent',
    props: ['parentData'],
    methods: {
        handleClick() {
            eventBus.$emit('callReply', this.parentData.id)
        }
    }
}
</script>

<style lang="less" scoped>
.parentWrapper {
    border: 1px solid #e4e4e4;
    padding: 4/360*100vw;
}
.info {
    display: flex;
    .date {
        flex: 1;
        padding-left: 10/360*100vw;
        font-size: 12/360*100vw;
        color: #888;
    }
}
.btnReply {
    font-size: 14/360*100vw;
    color: #888;
}
.mainContent {
    padding:  10/360*100vw 0;
}
</style>